package com.xishu.entity.shop;

import com.xishu.annotation.dao.FieldMapping;
import com.xishu.annotation.oplog.OplogAnnotation;
import com.xishu.entity.AbstractEntity;
import com.xishu.entity.ShopItem;
import com.xishu.entity.oplog.OpName;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.*;
import java.util.List;

@Entity(name = "line_up_config")
@Table(indexes = {@Index(columnList = "shopId")})
public class LineUpConfig extends ShopItem implements OpName {
    private static final long serialVersionUID = -4636817627143239029L;

    @Transient
    private String opName;

    @ApiModelProperty(name = "名称")
    @OplogAnnotation(fieldName = "名称")
    private String name;

    @ApiModelProperty(value = "归属的餐厅公司")
    private Long companyId;

    @ApiModelProperty(value = "分店的ID")
    private Long shopId;

    @Transient
    @ApiModelProperty(value = "适用的场景")
    @FieldMapping(desField = "sceneJson", serialize = true)
    private List<Long> sceneList;

    @ApiModelProperty(value = "适用的场景")
    @FieldMapping(desField = "sceneList", serialize = false, genericType = "java.lang.Long")
    @Column(length = 1024)
    @OplogAnnotation(fieldName = "适用的场景")
    private String sceneJson;

    @ApiModelProperty(value = "用户扫码排队开启")
    private Boolean onlineShow;

    @ApiModelProperty(value = "服务员排队开启")
    private Boolean offlineShow;

    @ApiModelProperty(value = "最大排队人数")
    @OplogAnnotation(fieldName = "最大排队人数")
    private Integer maxLinePersons;

    @ApiModelProperty(value = "队列前缀,有意义的排列，A,B,C等")
    @OplogAnnotation(fieldName = "队列前缀")
    private String code;

    @ApiModelProperty(value = "平均排队时间")
    private Integer waitAvgTime;

    @Transient
    @ApiModelProperty(value = "场景归属的分店")
    private String shopName_zh;

    @Transient
    @ApiModelProperty(value = "场景归属的分店")
    private String shopName_en;

    @Transient
    @ApiModelProperty(value = "公司名称")
    private String companyName;

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getShopName_zh() {
        return shopName_zh;
    }

    public void setShopName_zh(String shopName_zh) {
        this.shopName_zh = shopName_zh;
    }

    public String getShopName_en() {
        return shopName_en;
    }

    public void setShopName_en(String shopName_en) {
        this.shopName_en = shopName_en;
    }

    public List<Long> getSceneList() {
        return sceneList;
    }

    public void setSceneList(List<Long> sceneList) {
        this.sceneList = sceneList;
    }

    public String getSceneJson() {
        return sceneJson;
    }

    public void setSceneJson(String sceneJson) {
        this.sceneJson = sceneJson;
    }

    public String getName() {
        return name;
    }

    @Override
    public String opType() {
        return "排队配置";
    }

    @Override
    public String[] fieldName() {
        return new String[]{"shopId", "name"};
    }

    public void setName(String name) {
        this.name = name;
    }

    public Long getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Long companyId) {
        this.companyId = companyId;
    }

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    public Boolean getOnlineShow() {
        return onlineShow;
    }

    public void setOnlineShow(Boolean onlineShow) {
        this.onlineShow = onlineShow;
    }

    public Boolean getOfflineShow() {
        return offlineShow;
    }

    public void setOfflineShow(Boolean offlineShow) {
        this.offlineShow = offlineShow;
    }

    public Integer getMaxLinePersons() {
        return maxLinePersons;
    }

    public void setMaxLinePersons(Integer maxLinePersons) {
        this.maxLinePersons = maxLinePersons;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Integer getWaitAvgTime() {
        return waitAvgTime;
    }

    public void setWaitAvgTime(Integer waitAvgTime) {
        this.waitAvgTime = waitAvgTime;
    }

    @Override
    public String getOpName() {
        return opName;
    }

    @Override
    public void setOpName(String opName) {
        this.opName = opName;
    }
}
